package zzz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import zzz.mapper.OrderMapper;
import zzz.model.GetOrder;
import zzz.model.Order;
import zzz.service.OrderService;

@Service
@Transactional
public class OrderServiceImpl implements OrderService{

	@Autowired(required=true)
	public OrderMapper mapper;
	@Override
	public List<Order> getAllOrder() {
		// TODO Auto-generated method stub
		System.out.println(mapper.getAllOrder());
		return mapper.getAllOrder();
	}
	@Override
	public Order getOrderDetailById(String hoId) {
		// TODO Auto-generated method stub
		Order orderDetail=mapper.getOrderDetailById(hoId);
		System.out.println(orderDetail);
		return orderDetail;
	}
	@Override
	public int publishNewOrder(Order order) {
		// TODO Auto-generated method stub
		return mapper.publishNewOrder(order);
	}
	@Override
	public List<Order> getMyOrdr(String userId) {
		// TODO Auto-generated method stub
		return mapper.getMyOrder(userId);
	}
	@Override
	public void delOrder(String hoId) {
		// TODO Auto-generated method stub
		mapper.delOrder(hoId);
		System.out.println(hoId);
	}
	@Override
	public int addOrderForGetOrder(GetOrder getOrder,String userId) {
		// TODO Auto-generated method stub
		System.out.println("service������userId:"+userId);
		return mapper.addOrderForGetOrder(getOrder);
	}
	@Override
	public void updateOrderStatus(String hoId, int hoState) {
		// TODO Auto-generated method stub
		System.out.println("����service��hoId:"+hoId);
		System.out.println("����service��hoState:"+hoState);
		mapper.updateOrderStatus(hoId, hoState);
	}
	@Override
	public void updateOrderStatus1(String hoId, int hoState) {
		// TODO Auto-generated method stub
		mapper.updateOrderStatus1(hoId, hoState);
	}
	@Override
	public List<Order> myGetOrder(String userId) {
		// TODO Auto-generated method stub
		return mapper.myGetOrder(userId);
	}

}
